import request from '@/utils/request'

// 获取操作日志列表
export const getOperationLogs = (current, size , {id,title,businessType,method,requestMethod,operatorType,
    operatorName,deptName,operatorUrl,operatorIp,operatorLocation,operatorParam,
    jsonResult,status,errormsg,operatorTime,costTime}) => request.get('/system/log/operation', {
  params: {
    current,
    size,
    id,title,businessType,method,requestMethod,operatorType,operatorName,
    deptName,operatorUrl,operatorIp,operatorLocation,operatorParam,
    jsonResult,status,errormsg,operatorTime,costTime
  }
})

// 获取登录日志列表
export const getLoginLogs = (current , size , {id,userName,ipAddr,loginLocation,browser,os,status,msg,operTime}) => request.get('/system/log/login', {
  params: {
    current,
    size,
    id,userName,ipAddr,loginLocation,browser,os,status,msg,operTime
  }
})

// 删除操作日志
export const deleteOperationLog = (ids) => request.delete(`/system/log/operation/${ids}`)

// 删除登录日志
export const deleteLoginLog = (ids) => request.delete(`/system/log/login/${ids}`)

// 清空操作日志
export const cleanOperationLog = () => request.delete('/system/log/operation/clean')

// 清空登录日志
export const cleanLoginLog = () => request.delete('/system/log/login/clean')